package com.sikaryofficial.backend.constant;

import com.sikaryofficial.common.core.constant.CacheBusinessConstants;

/**
 * @author : qinjinyuan
 * @desc : 缓存常量key
 * @date : 2023/10/28 16:19
 */
public class RedisCacheKey extends CacheBusinessConstants {

    /**
     * 通过IP获取地理信息 (DB1)
     * {0} IP字符串对应的 整数值 (ipV4 可以用整数)
     */
    public static final String IP_LOCATION_DB1_CACHE = "hismk:ip:location:db1:{0}";
    /**
     * 通过IP获取地理信息 （DB3-支持国家-城市）
     * {0} IP字符串对应的 整数值 (ipV4 可以用整数)
     */
    public static final String IP_LOCATION_DB3_CACHE = "hismk:ip:location:db3:{0}";
    /**
     * 首页浏览数量缓存key
     * <p>
     * {0} 日期 :yyyyMMdd
     * {1} userId
     */
    public static final String BROWSE_DURATION_HOME_POINTS_NUM = "hismk:browseDurationHome:points:{0}:{1}:num";
    /**
     * 首页发帖数量缓存key
     * <p>
     * {0} 日期 :yyyyMMdd
     * {1} userId
     */
    public static final String OWNER_INFO_MODIFY_POINTS_NUM = "hismk:ownerInfoModify:points:{0}:{1}:num";
    /**
     * 文章发布被置顶数量缓存key
     * <p>
     * {0} sourceId 文章ID
     */
    public static final String ARTICLE_TOP_UP_POINTS_NUM = "hismk:articleTopUp:points:{0}:{1}:num";
    /**
     * 文章发布被置顶唯一缓存key
     * <p>
     * {0} sourceId
     */
    public static final String ARTICLE_TOP_UP_POINTS_UNION = "hismk:articleTopUp:points:union:{0}";
    /**
     * 发帖带指定topic服务数量缓存key
     * <p>
     * {0} 日期 :yyyyMMdd
     * {1} userId
     */
    public static final String ARTICLE_APPOINT_TOPIC_POINTS_NUM = "hismk:articleAppointTopic:points:{0}:{1}:num";
    /**
     * 首页发帖数量缓存key
     * <p>
     * {0} 日期 :yyyyMMdd
     * {1} userId
     */
    public static final String ARTICLE_PUBLISH_HOME_POINTS_NUM = "hismk:articlePublishHome:points:{0}:{1}:num";
    /**
     * 文章评价回复次数缓存key
     * <p>
     * {0} 日期 :yyyyMMdd
     * {1} userId
     */
    public static final String ARTICLE_EVALUATE_REPLY_POINTS_NUM = "hismk:articleEvaluateReply:points:{0}:{1}:num";

    /**
     * 文章评价次数缓存key
     * <p>
     * {0} 日期 :yyyyMMdd
     * {1} userId
     */
    public static final String ARTICLE_EVALUATE_POINTS_NUM = "hismk:articleEvaluate:points:{0}:{1}:num";
    /**
     * 文章收到的点赞次数缓存key
     * * <p>
     *   {0} 日期 :yyyyMMdd
     *   {1} userId
     */
    public static final String ARTICLE_RECEIVED_LIKE_POINTS_NUM = "hismk:articleReceivedLike:points:{0}:{1}:num";
    /**
     * 文章点赞次数缓存key
     * <p>
     * {0} 日期 :yyyyMMdd
     * {1} userId
     */
    public static final String ARTICLE_LIKE_POINTS_NUM = "hismk:articleLike:points:{0}:{1}:num";

    /**
     * 文章浏览次数缓存key
     * <p>
     * {0} 日期 :yyyyMMdd
     * {1} userId
     */
    public static final String ARTICLE_VIEW_LIKE_POINTS_NUM = "hismk:articleViewLike:points:{0}:{1}:num";
    /**
     * 帖子浏览点赞唯一缓存key
     * <p>
     * {0} sourceId
     * {1} userId
     */
    public static final String ARTICLE_VIEW_LIKE_POINTS_UNION = "hismk:articleViewLike:points:union:{0}:{1}";
    /**
     * 帖子点赞唯一缓存key
     * <p>
     * {0} sourceId
     * {1} userId
     */
    public static final String ARTICLE_LIKE_POINTS_UNION = "hismk:articleLike:points:union:{0}:{1}";
    /**
     * 帖子点赞带指定topic服务唯一缓存key
     * <p>
     * {0} sourceId
     * {1} userId
     */
    public static final String ARTICLE_LIKE_WITH_TOPIC_POINTS_UNION = "hismk:articleLikeWithTopic:points:union:{0}:{1}";
    /**
     * 帖子点赞带指定topic服务数量缓存key
     * <p>
     * {0} 日期 :yyyyMMdd
     * {1} userId
     */
    public static final String ARTICLE_LIKE_WITH_TOPIC_POINTS_NUM = "hismk:articleLikeWithTopic:points:{0}:{1}:num";
    /**
     * 文章点赞次数缓存key
     * <p>
     * {0} 日期 :yyyyMMdd
     * {1} userId
     */
    public static final String SCAN_TASK_POINTS_NUM = "hismk:scanTask:points:{0}:{1}:num";
    /**
     * 签到次数缓存key
     * <p>
     * {0} 日期 :yyyyMMdd
     * {1} userId
     */
    public static final String SIGN_POINTS_NUM = "hismk:sign:points:{0}:{1}:num";
    /**
     * 口味评价次数缓存key
     * <p>
     * {0} 日期 :yyyyMMdd
     * {1} userId
     */
    public static final String EVALUATE_POINTS_NUM = "hismk:evaluate:points:{0}:{1}:num";
    /**
     * 店铺分享次数缓存key
     * <p>
     * {0} 日期 :yyyyMMdd
     * {1} userId
     */
    public static final String SHARE_STORE_NUM = "hismk:shareStore:points:{0}:{1}:num";

    /**
     * 产品指标统计查询缓存
     */
    public static final String BRAND_TASTE_INDEX_STATISTICS_KEY = "hismk:brandtaste:indexstatistics";
    /**
     * 产品指标统计查询缓存
     * <p>
     * {0} brandtasteID
     */
    public static final String BRAND_TASTE_INDEX_STATISTICS_CACHE = BRAND_TASTE_INDEX_STATISTICS_KEY + ":{0}";
    /**
     * 店铺所有列表缓存
     */
    public static final String STORE_ALL_LIST_CACHE = "hismk:store:all:list";
    /**
     * 店铺空间点位列表缓存
     */
    public static final String STORE_POINT_LIST_CACHE = "hismk:store:geoPoint:list";

    /**
     * 店铺空间点位列表缓存
     */
    public static final String STORE_RECOMMEND_Z_SET_KEY = "hismk:store:recommend:score";


    public static final String STORE_RECOMMEND_Z_SET_LOCK = "hismk:store:recommend:score:lock";

    /**
     * 距离最近的top3专卖店缓存
     * {0} userID
     * {1} longitude
     * {2} latitude
     */
    public static final String STORE_TOP3_CACHE = "hismk:store:top3:{0}:{1}:{2}";

    /**
     * 搜索统计缓存
     * {0}  md5字符串
     */
    public static final String STORE_SEARCH_COUNT_CACHE = "hismk:store:search:count:{0}";
    /**
     * 搜索统计缓存
     * {0}  storeId
     * {1}  userId
     */
    public static final String STORE_VIEW_COUNT_CACHE = "hismk:store:view:{0}:{1}";

    /**
     * 用户评价次数缓存key
     * <p>
     * {0} userId
     * {1} storeId
     */
    public static final String STORE_USER_COMMENT_POINTS_NUM = "hismk:store:comment:points:{0}:{1}:num";
    /**
     * 我的个人统计查询缓存
     * <p>
     * {0} userId
     */
    public static final String MY_STATISTICS_CACHE = "hismk:myStatistics:{0}";
    /**
     * 品牌专栏统计查询缓存
     * <p>
     * {0} brandNo
     */
    public static final String BRAND_SPECIAL_STATISTICS_CACHE = "hismk:brandSpecialStatistics:{0}";
    /**
     * 国家-地址列表缓存
     */
    public static final String ADDRESS_ALL_LIST_CACHE = "hismk:address:all:{0}";
    /**
     * 国家列表缓存
     */
    public static final String ADDRESS_COUNTRY_LIST_CACHE = "hismk:address:country:list";
    /**
     * 用户协议缓存
     * {0} 协议类型：1-用户协议,2-隐私协议
     */
    public static final String PROTOCOL_TYPE_DATA_CACHE = "hismk:protocol:{0}";
    /**
     * 活动预约状态缓存
     * {0} 活动ID
     * {1} 用户ID
     */
    public static final String ACTIVITY_RESERVE_STATUS_CACHE = "hismk:activity:reserve:status:{0}:{1}";
    /**
     * 活动抢购结果缓存
     * {0} 活动ID
     * {1} 用户ID
     */
    public static final String ACTIVITY_ATTEND_RESULT_CACHE = "hismk:activity:attend:result:{0}:{1}";

    /**
     * 活动奖项关系ID缓存
     * {0} 活动ID
     */
    public static final String ACTIVITY_RELATION_ID_CACHE = "hismk:activity:{0}";

    /**
     * 产品二维码生成临时缓存
     * {0} 产品MD5
     */
    public static final String ACTIVITY_WINNER_EXPORT_STATUS_PREFIX = "hismk:activity:winner:export:status";

    public static final String PRIZE_WINNER_EXPORT_STATUS_PREFIX = "hismk:prize:winner:export:status";

    /**
     * 产品二维码生成临时缓存
     * {0} 产品MD5
     */
    public static final String ACTIVITY_WINNER_EXPORT_STATUS_CACHE = ACTIVITY_WINNER_EXPORT_STATUS_PREFIX + ":{0}";

    public static final String PRIZE_WINNER_EXPORT_STATUS_CACHE = PRIZE_WINNER_EXPORT_STATUS_PREFIX + ":{0}";

    public static final String ACTIVITY_WINNER_EXPORT_LOCK = "hismk:activity:winner:lock:{0}";

    public static final String PRIZE_WINNER_EXPORT_LOCK = "hismk:prize:winner:lock:{0}";

    public static final String EXPORT_STATUS_PREFIX = "hismk:manual:export:status";

    public static final String EXPORT_STATUS_PREFIX_CACHE = EXPORT_STATUS_PREFIX + ":{0}";

    public static final String EXPORT_STATUS_PREFIX_LOCK = "hismk:manual:export:lock:{0}";


    public static final String ACTIVITY_PHYSICAL_RESULT_ITEM = "hismk:activity:physical:result";

    public static final String ACTIVITY_PHYSICAL_RESULT_PREFIX = "hismk:activity:physical:result:{0}";
    /**
     * 活动实物奖项结果缓存
     * {0} 活动ID
     * {1} 用户ID
     * <p>
     * 值是实物奖项结果集合
     */
    public static final String ACTIVITY_PHYSICAL_RESULT_CACHE = ACTIVITY_PHYSICAL_RESULT_ITEM + ":{0}:{1}";

    /**
     * 活动基本信息缓存
     * {0} 活动ID
     */
    public static final String ACTIVITY_BASE_INFO_CACHE = "hismk:activity:baseInfo:{0}";

    /**
     * 活动参与次数缓存
     * {0} 活动ID
     * {1} 日期 yyyyMMdd
     * {2} userId
     */
    public static final String ACTIVITY_ATTEND_DAILY_NUM_CACHE = "hismk:activity:attend:dailyNum:{0}:{1}:{2}";

    /**
     * 活动参与次数缓存
     * {0} activityID 活动ID
     * {1} param 二维码参数
     */
    public static final String ACTIVITY_ATTEND_NUM_CACHE = "hismk:activity:attend:num:{0}:{1}";

    /**
     * 活动库存缓存
     * {0} 活动ID
     * {1} 活动奖项ID
     */
    public static final String ACTIVITY_STOCK_DATA_CACHE = "hismk:activity:stock:{0}:{1}";
    /**
     * 活动扩展库存缓存
     * {0} 活动ID
     * {1} 活动奖项ID
     */
    public static final String ACTIVITY_STOCK_EXT_DATA_CACHE = "hismk:activity:stockExt:{0}:{1}";
    /**
     * 活动锁缓存
     * {0} 活动ID
     */
    public static final String ACTIVITY_LOCK_CACHE = "hismk:activity:lock:{0}";
    /**
     * 用户点赞收藏行为是否加载缓存
     * <p>
     * {0} userId
     */
    public static final String USER_ACTION_LOAD_FLAG_CACHE = "hismk:user:load:flag:{0}";
    /**
     * 用户点赞收藏行为缓存
     * <p>
     * {0} userId
     * {1} 业务类型6-产品点赞;8-产品评价点赞;9-产品评价回复点赞;3-店铺收藏;10-产品收藏;15-活动收藏;
     * {2} 业务对象ID
     */
    public static final String USER_ACTION_HASH_CACHE = "hismk:user:action:{0}:{1}:{2}";
    /**
     * 商品二维码缓存
     * {0} 产品16进制ID字符串
     */
    public static final String PRODUCT_QRCODE_SCAN_CACHE = "hismk:product:qrcode:scan:{0}";
    /**
     * 国家编码集合缓存
     */
    public static final String COUNTRY_CODE_LIST_CACHE = "hismk:country:code:list:cache";

    /**
     * 国家2位编码集合缓存
     */
    public static final String COUNTRY_SHORT_CODE_HASH_CACHE = "hismk:country:shortcode:hash:cache";

    /**
     * 最新评价缓存
     * {0} style
     * {1} brand
     * {2} limitNum
     */
    public static final String LATEST_EVALUATE_STYLE_CACHE = "hismk:latest:evaluate:{0}:{1}:{2}";
    /**
     * 最经典评价缓存
     * {0} style
     * {1} brand
     * {2} limitNum
     */
    public static final String MOST_EVALUATE_STYLE_CACHE = "hismk:most:evaluate:{0}:{1}:{2}";
    /**
     * 最经典评价缓存
     * {0} style
     * {1} brand
     * {2} limitNum
     */
    public static final String TOP_PRODUCT_STYLE_CACHE = "hismk:top:product:{0}:{1}:{2}";
    /**
     * 最新分享的店铺缓存
     * {0} md5 = MD5(pageNum+pageSize + longitude + latitude)
     */
    public static final String HISMK_STORE_EVALUATE_LIST_PREFIX = "hismk:store:evaluate:list";
    /**
     * 最新分享的店铺缓存
     * {0} md5 = MD5(pageNum+pageSize + longitude + latitude)
     */
    public static final String HISMK_STORE_EVALUATE_LIST_CACHE = HISMK_STORE_EVALUATE_LIST_PREFIX + ":{0}";

    /**
     * 文章检索缓存
     * {0} md5 = MD5(pageNum+pageSize + headline + tenantIdStr)
     */
    public static final String HISMK_ARTICLE_ASSOCIATE_LIST = "hismk:article:associate:list:{0}";
    /**
     * 文章后台发布文章统计缓存
     * {0} brandNo
     */
    public static final String HISMK_ARTICLE_BACKEND_STATISTICS = "hismk:article:backend:statistics:{0}";

    /**
     * 品牌专栏列表缓存
     */
    public static final String HISMK_BRAND_SPECIAL_LIST = "hismk:brand:special:list";

    /**
     * 文章后台发布文章统计缓存
     */
    public static final String HISMK_POINTS_RULE_CONFIG_HASH = "hismk:points:rule:config";

    public static final String USER_MONTHLY_PHYSICAL_WIN_COUNT_PREFIX = "hismk:user:monthly:physical:win:count";
    /**
     * 实物奖项中奖次数 key
     * {0} yyyyMM
     * {1} userId
     */
    public static final String USER_MONTHLY_PHYSICAL_WIN_COUNT = USER_MONTHLY_PHYSICAL_WIN_COUNT_PREFIX + ":{0}:{1}";
    /**
     * 工作台-更新已读消息
     * {0} userId
     * {1} businessType
     */
    public static final String BACKEND_UPDATE_READ_KEY =  "hismk:backend:update:read:{0}:{1}";
    /**
     * 文章浏览记录缓存
     * {0} userId
     * {1} articleId
     */
    public static final String HISMK_BACKEND_ARTICLE_VIEW = "hismk:backend:article:view:{0}:{1}";
    /**
     * 点赞记录缓存
     * {0} userId
     * {1} articleId
     */
    public static final String HISMK_BACKEND_ARTICLE_LIKE = "hismk:backend:article:like:{0}:{1}";
}